package com.cjm.one.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.custom.client.CustomerInfoClient;
import com.cjm.one.model.base.TokenVo;
import com.cjm.one.model.custom.entity.CustomGrade;
import com.cjm.one.model.custom.entity.CustomerInfo;
import com.cjm.one.model.custom.vo.CustomerInfoVo;
import com.cjm.one.model.custom.vo.RegisterVO;
import com.cjm.one.model.system.vo.LoginVo;
import com.cjm.one.service.AuthLoginService;
import jakarta.annotation.Resource;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class AuthLoginServiceImpl implements AuthLoginService {

    @Resource
    private CustomerInfoClient customerInfoClient;



    @Override
    public Result<String> sendEmailCode(String email)  {
        return customerInfoClient.emailCode(email);
    }

    @Override
    public Result<TokenVo> login(LoginVo loginVo) {
        return  customerInfoClient.login(loginVo);
    }

    @Override
    public Result<CustomerInfoVo> getUserInfo() {
        log.info("getUserInfo");
        return customerInfoClient.userInfo();
    }

    @Override
    public Result<Boolean> register(RegisterVO registerVO) {
        return customerInfoClient.register(registerVO);
    }

    @Override
    public Result<Boolean> checkEmail(String email) {
        return customerInfoClient.checkEmail(email);
    }

    @Override
    public Result<Boolean> checkEmailCode(String email, String code) {
        return customerInfoClient.checkEmailCode(email,code);
    }


}
